<template>  
    <div>  
      <button @click="toggleFullscreen">切换全屏</button>  
    </div>  
  </template>  
    
  <script>  
  import screenfull from 'screenfull';  
    
  export default {  
    methods: {  
      toggleFullscreen() {  
        if (screenfull.isEnabled) {  
          screenfull.toggle();  
        } else {  
          console.log('您的浏览器不支持全屏');  
        }  
      }  
    }  
  }  
  </script>